(function() {
  var express, iced, router, sysinfo, __iced_k, __iced_k_noop;

  iced = require('iced-runtime');
  __iced_k = __iced_k_noop = function() {};

  express = require('express');

  sysinfo = require('systeminformation');

  router = express.Router();

  module.exports = router;

  router.get('/', function(req, res, next) {
    var data, index, item, network_stats, ___iced_passed_deferral, __iced_deferrals, __iced_k;
    __iced_k = __iced_k_noop;
    ___iced_passed_deferral = iced.findDeferral(arguments);
    res.locals.version = sysinfo.version();
    res.locals.uptime = sysinfo.time().uptime;
    (function(_this) {
      return (function(__iced_k) {
        __iced_deferrals = new iced.Deferrals(__iced_k, {
          parent: ___iced_passed_deferral,
          filename: "/home/qiwei/Desktop/luckpay-web/coffee/routes/stats.coffee"
        });
        sysinfo.system(__iced_deferrals.defer({
          assign_fn: (function() {
            return function() {
              return data = arguments[0];
            };
          })(),
          lineno: 17
        }));
        __iced_deferrals._fulfill();
      });
    })(this)((function(_this) {
      return function() {
        res.locals.system = data;
        (function(__iced_k) {
          __iced_deferrals = new iced.Deferrals(__iced_k, {
            parent: ___iced_passed_deferral,
            filename: "/home/qiwei/Desktop/luckpay-web/coffee/routes/stats.coffee"
          });
          sysinfo.osInfo(__iced_deferrals.defer({
            assign_fn: (function() {
              return function() {
                return data = arguments[0];
              };
            })(),
            lineno: 21
          }));
          __iced_deferrals._fulfill();
        })(function() {
          res.locals.os_info = data;
          (function(__iced_k) {
            __iced_deferrals = new iced.Deferrals(__iced_k, {
              parent: ___iced_passed_deferral,
              filename: "/home/qiwei/Desktop/luckpay-web/coffee/routes/stats.coffee"
            });
            sysinfo.cpu(__iced_deferrals.defer({
              assign_fn: (function() {
                return function() {
                  return data = arguments[0];
                };
              })(),
              lineno: 25
            }));
            __iced_deferrals._fulfill();
          })(function() {
            res.locals.cpu = data;
            (function(__iced_k) {
              __iced_deferrals = new iced.Deferrals(__iced_k, {
                parent: ___iced_passed_deferral,
                filename: "/home/qiwei/Desktop/luckpay-web/coffee/routes/stats.coffee"
              });
              sysinfo.mem(__iced_deferrals.defer({
                assign_fn: (function() {
                  return function() {
                    return data = arguments[0];
                  };
                })(),
                lineno: 29
              }));
              __iced_deferrals._fulfill();
            })(function() {
              res.locals.mem = JSON.stringify(data);
              (function(__iced_k) {
                __iced_deferrals = new iced.Deferrals(__iced_k, {
                  parent: ___iced_passed_deferral,
                  filename: "/home/qiwei/Desktop/luckpay-web/coffee/routes/stats.coffee"
                });
                sysinfo.fsSize(__iced_deferrals.defer({
                  assign_fn: (function() {
                    return function() {
                      return data = arguments[0];
                    };
                  })(),
                  lineno: 34
                }));
                __iced_deferrals._fulfill();
              })(function() {
                res.locals.fs_size = JSON.stringify(data);
                (function(__iced_k) {
                  __iced_deferrals = new iced.Deferrals(__iced_k, {
                    parent: ___iced_passed_deferral,
                    filename: "/home/qiwei/Desktop/luckpay-web/coffee/routes/stats.coffee"
                  });
                  sysinfo.currentLoad(__iced_deferrals.defer({
                    assign_fn: (function() {
                      return function() {
                        return data = arguments[0];
                      };
                    })(),
                    lineno: 38
                  }));
                  __iced_deferrals._fulfill();
                })(function() {
                  res.locals.cpu_load = JSON.stringify(data);
                  network_stats = [];
                  (function(__iced_k) {
                    __iced_deferrals = new iced.Deferrals(__iced_k, {
                      parent: ___iced_passed_deferral,
                      filename: "/home/qiwei/Desktop/luckpay-web/coffee/routes/stats.coffee"
                    });
                    sysinfo.networkInterfaces(__iced_deferrals.defer({
                      assign_fn: (function() {
                        return function() {
                          return data = arguments[0];
                        };
                      })(),
                      lineno: 43
                    }));
                    __iced_deferrals._fulfill();
                  })(function() {
                    (function(__iced_k) {
                      var _i, _len, _ref, _results, _while;
                      _ref = data;
                      _len = _ref.length;
                      index = 0;
                      _while = function(__iced_k) {
                        var _break, _continue, _next;
                        _break = __iced_k;
                        _continue = function() {
                          return iced.trampoline(function() {
                            ++index;
                            return _while(__iced_k);
                          });
                        };
                        _next = _continue;
                        if (!(index < _len)) {
                          return _break();
                        } else {
                          item = _ref[index];
                          (function(__iced_k) {
                            if (index > 0) {
                              (function(__iced_k) {
                                __iced_deferrals = new iced.Deferrals(__iced_k, {
                                  parent: ___iced_passed_deferral,
                                  filename: "/home/qiwei/Desktop/luckpay-web/coffee/routes/stats.coffee"
                                });
                                sysinfo.networkStats(item.iface, __iced_deferrals.defer({
                                  assign_fn: (function() {
                                    return function() {
                                      return data = arguments[0];
                                    };
                                  })(),
                                  lineno: 46
                                }));
                                __iced_deferrals._fulfill();
                              })(function() {
                                return __iced_k(network_stats.push(data));
                              });
                            } else {
                              return __iced_k();
                            }
                          })(_next);
                        }
                      };
                      _while(__iced_k);
                    })(function() {
                      res.locals.network_stats = JSON.stringify(network_stats);
                      return res.render('stats');
                    });
                  });
                });
              });
            });
          });
        });
      };
    })(this));
  });

}).call(this);
